package com.netnovelstore.util;

import com.netnovelstore.pojo.User;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class TokenCacheManage {

    public final static Map<String, User> tokenMap = new ConcurrentHashMap<>();

    public static void add(String token, User user){
        tokenMap.put(token,user);
    }

    public static User get(String token){
        return tokenMap.getOrDefault(token, null);
    }

}
